import esriLoader from 'esri-loader'
var initMeasure = function (type,mapId) {
  esriLoader.loadModules(["widget/Measure","widget/MapManager"])
    .then(([Measure,MapManager]) => {
      var map = MapManager.getMap(mapId);
      var measure = new Measure({map: map});
      measure.activate(type);
    })
    .catch(err => {
      // handle any script or module loading errors
      console.error(err);
    })
}
export default {
  initMeasure
}

